package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appmarket.service.store.awk.card.DetailVanAttendGeneralCard;
import com.huawei.appmarket.service.webview.base.jssdk.control.FullAppStatus;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import java.lang.ref.WeakReference;
import java.util.UUID;
import o.cdr;
import o.Logger;
import o.ContentManager;
import o.eib;
import o.end;
import o.enf;
import o.ewm.h;
import o.ll;

public class DetailVanAttendNode extends cdr implements end {
    private DetailVanAttendGeneralCard ˊ;
    private String ॱॱ = UUID.randomUUID().toString();
    private b ᐝ = new b();

    static final class b extends SafeBroadcastReceiver {
        private WeakReference<DetailVanAttendGeneralCard> ˏ;

        private b() {
        }

        public void ॱ(DetailVanAttendGeneralCard detailVanAttendGeneralCard) {
            this.ˏ = new WeakReference(detailVanAttendGeneralCard);
        }

        public void onReceiveMsg(Context context, Intent intent) {
            if ("com.huawei.appmarket.service.fill.vanattend.question".equals(intent.getAction())) {
                String stringExtra = intent.getStringExtra("VAN_ATTEND_FILL_QUESTION_USERID");
                String stringExtra2 = intent.getStringExtra("VAN_ATTEND_FILL_QUESTION_ID");
                if (this.ˏ == null) {
                    Logger.ˎ("DetailVanAttendNode", "cardReference == null");
                    return;
                }
                DetailVanAttendGeneralCard detailVanAttendGeneralCard = (DetailVanAttendGeneralCard) this.ˏ.get();
                if (detailVanAttendGeneralCard == null) {
                    Logger.ˎ("DetailVanAttendNode", "card == null");
                } else {
                    detailVanAttendGeneralCard.ˋ(stringExtra, stringExtra2);
                }
            }
        }
    }

    public DetailVanAttendNode(Context context) {
        super(context, eib.ॱˎ());
    }

    public void ॱˊ() {
        super.ॱˊ();
        enf.ˋ().ˎ(this.ॱॱ, this);
        ˎ();
    }

    protected void ˎ() {
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.huawei.appmarket.service.fill.vanattend.question");
        ll.ˏ(ContentManager.getInstant().getContext().getApplicationContext()).ˏ(this.ᐝ, intentFilter);
        if (Logger.ˎ()) {
            Logger.ˏ("DetailVanAttendNode", "registerReceiver");
        }
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        View inflate = LayoutInflater.from(this.ॱ).inflate(h.ـ, null);
        this.ˊ = new DetailVanAttendGeneralCard(this.ॱ);
        this.ˊ.ˎ(inflate);
        ˊ(this.ˊ);
        this.ᐝ.ॱ(this.ˊ);
        viewGroup.addView(inflate, layoutParams);
        return true;
    }

    public void ॱˎ() {
        super.ॱˎ();
        enf.ˋ().ˊ(this.ॱॱ);
        ˋ();
    }

    private void ˋ() {
        if (this.ᐝ != null) {
            ll.ˏ(ContentManager.getInstant().getContext().getApplicationContext()).ˋ(this.ᐝ);
            if (Logger.ˎ()) {
                Logger.ˏ("DetailVanAttendNode", "unRegisterReceiver");
            }
        }
    }

    public void ॱ(FullAppStatus fullAppStatus) {
        Logger.ˎ("DetailVanAttendNode", "refreshAppStatus");
        if (fullAppStatus == null) {
            Logger.ˎ("DetailVanAttendNode", "appStatus == null");
        } else if (fullAppStatus.ˋ() != 1) {
        } else {
            if (this.ˊ == null) {
                Logger.ˎ("DetailVanAttendNode", "card == null");
            } else {
                this.ˊ.ˎ(fullAppStatus.ˎ());
            }
        }
    }
}
